﻿using System;
using System.Collections.Generic;
using System.Linq;
using SqlSugar;
namespace Zhao.Models.Entity
{
    /// <summary>
    /// 用户表（核心账户信息）
    ///</summary>
    [SugarTable("Users")]
    public class Users
    {


        /// <summary>
        /// 备  注:
        /// 默认值:
        ///</summary>
        [SugarColumn(ColumnName = "UserID", IsPrimaryKey = true, IsIdentity = true)]
        public int UserID { get; set; }

        /// <summary>
        /// 备  注:用户名（唯一标识，登录用）
        /// 默认值:
        ///</summary>
        [SugarColumn(ColumnName = "Username")]
        public string Username { get; set; } = null!;

        /// <summary>
        /// 备  注:加密后的密码（SHA256+盐值）
        /// 默认值:
        ///</summary>
        [SugarColumn(ColumnName = "PasswordHash")]
        public string PasswordHash { get; set; } = null!;

        /// <summary>
        /// 备  注:用户真实姓名
        /// 默认值:
        ///</summary>
        [SugarColumn(ColumnName = "RealName")]
        public string? RealName { get; set; }

        /// <summary>
        /// 备  注:绑定手机号（登录/通知）
        /// 默认值:
        ///</summary>
        [SugarColumn(ColumnName = "Phone")]
        public string Phone { get; set; } = null!;

        /// <summary>
        /// 备  注:账户余额（支持线上支付）
        /// 默认值:
        ///</summary>
        [SugarColumn(ColumnName = "AccountBalance")]
        public decimal? AccountBalance { get; set; }

        /// <summary>
        /// 备  注:账户状态：0-冻结，1-正常
        /// 默认值:
        ///</summary>
        [SugarColumn(ColumnName = "Status")]
        public short Status { get; set; }

        /// <summary>
        /// 备  注:软删除标记（0-未删除，1-已删除）
        /// 默认值:
        ///</summary>
        [SugarColumn(ColumnName = "IsDeleted")]
        public bool? IsDeleted { get; set; }

        /// <summary>
        /// 备  注:创建时间（用户注册时间）
        /// 默认值:
        ///</summary>
        [SugarColumn(ColumnName = "CreatedAt")]
        public DateTime? CreatedAt { get; set; }

        /// <summary>
        /// 备  注:最后更新时间
        /// 默认值:
        ///</summary>
        [SugarColumn(ColumnName = "UpdatedAt")]
        public DateTime? UpdatedAt { get; set; }

        /// <summary>
        /// 备  注:用户的唯一标识（同一小程序内唯一）
        /// 默认值:
        ///</summary>
        [SugarColumn(ColumnName = "OpenID")]
        public string? OpenID { get; set; }

        /// <summary>
        /// 备  注:性别 1男 2 女
        /// 默认值:
        ///</summary>
        [SugarColumn(ColumnName = "Sex")]
        public int Sex { get; set; }

        /// <summary>
        /// 备  注:用户头像
        /// 默认值:
        ///</summary>
        [SugarColumn(ColumnName = "Avatar")]
        public string? Avatar { get; set; }


    }

}